/*
    Copyright ownership: Dreamless, 2025 - 2025
 */

package dome1;

import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Paths;

/**
 * 获取文件中的字符串，计算长度
 *
 * @author 梦无忧
 * @version 1.0
 * @since 2025-07-31 00:18:52
 */
public class WordCount {
    public static void main(String[] args){
        try {
            String word = new String(Files.readAllBytes(Paths.get("A:/3.study/study/2.后端/javaStudy/src/main/resources/stringTest.txt")), StandardCharsets.UTF_8);
            String[] words = word.split(", ");
            for (String string : words){
                System.out.println("'" + string + "'" + ".length: " + string.length());
            }
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
}
